package com.example.demo.Service;

import com.example.demo.Dao.CourierDao;
import com.example.demo.Entity.Count;
import com.example.demo.Entity.Courier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourierService {
    @Autowired
    public CourierDao courierDao;

    public List<Courier> getCourier() {
        return courierDao.getCourier();
    }

    public Courier inputCourierInfo(String number, Integer company, Integer expenses, String s_time, Integer state, Integer id, Integer u_id) {
        return courierDao.inputCourierInfo(company, number, expenses, s_time, state, id, u_id);
    }

    public Courier userSendCourierInfo(Courier courier) {
        return courierDao.userSendCourierInfo(courier);
    }

    public List<Courier> getNotProCourier() {
        return courierDao.getNotProCourier();
    }

    public List<Courier> updateCourier(Integer p_id, String s_sname, String s_sphone, String s_saddress, String s_idcode, String s_rname, String s_rphone, String s_raddress) {
        return courierDao.updateCourier(p_id, s_sname, s_sphone, s_saddress, s_idcode, s_rname, s_rphone, s_raddress);
    }

    public Integer deleteCourier(Integer id) {
        return courierDao.deleteCourier(id);
    }

    public List<Count> getSendCount() {
        return courierDao.getSendCount();
    }

    public List<Courier> getUserCourier(String name) {
        return courierDao.getUserCourier(name);
    }

    public List<Courier> getCouriered() {
        return courierDao.getCouriered();
    }

    public List<Courier> getCourierByname(String name) {
        return courierDao.getCourierByname(name);
    }

    public String getSendnameBypid(Integer p_id) {
        return courierDao.getSendnameBypid(p_id);
    }
}
